

package cn.shengchao.examstar.distribute.infrastrure.mapper;

import cn.shengchao.base.anotation.DistributeDataPermission;
import cn.shengchao.base.enums.DistributeDataScopeEnum;
import cn.shengchao.examstar.distribute.infrastrure.po.DistributeNodeInfo;
import cn.shengchao.examstar.rpc.distribute.req.DistributeNodeInfoQueryPage;
import cn.shengchao.examstar.rpc.distribute.req.DistributorQueryPage;
import cn.shengchao.examstar.rpc.distribute.req.DistributorStudentQueryPage;
import cn.shengchao.examstar.rpc.distribute.resp.DistributeNodeInfoRespEntity;
import cn.shengchao.examstar.rpc.distribute.resp.DistributorRespEntity;
import cn.shengchao.examstar.rpc.distribute.resp.DistributorStudentEntity;
import cn.shengchao.examstar.rpc.member.req.MemberQueryPage;
import cn.shengchao.examstar.rpc.member.res.MemberList;
import cn.shengchao.examstar.rpc.uddsys.resp.DistributeUserInviteSelectVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DistributeNodeInfoMapper extends BaseMapper<DistributeNodeInfo> {

    @DistributeDataPermission(dataScope = DistributeDataScopeEnum.SALE_DEPT_USER, distributeType = "2", nodeTableAlias="a")
    List<DistributorRespEntity> queryDistributorPageResult(@Param("query") DistributorQueryPage pageQuery);

    @DistributeDataPermission(dataScope = DistributeDataScopeEnum.SALE_INVITE_USER, distributeType = "2", inviteTableAlias="d")
    List<DistributorStudentEntity> queryDistributorStudentPageResult(@Param("query") DistributorStudentQueryPage pageQuery, @Param("userIds") List<Long> userIds);
    @DistributeDataPermission(dataScope = DistributeDataScopeEnum.SALE_DEPT_USER, distributeType = "2", nodeTableAlias="a")
    List<MemberList> getMemberList(@Param("query") MemberQueryPage memberQueryPage);


    List<DistributeUserInviteSelectVo> selectDistributeUserInviteSelectVo(@Param("searchValue") String searchValue);

    List<DistributeNodeInfoRespEntity> selectDistributeNodesByPage(@Param("query") DistributeNodeInfoQueryPage pageQuery);
}